import request from '@/utils/request'

export default {
  addCourseInfo(courseInfo) {
    return request({
      url: `/service_edu/course/addCourseInfo`,
      method: 'post',
      data: courseInfo
    })
  },
  getCourse(courseId) {
    return request({
      url: `/service_edu/course/${courseId}`,
      method: 'get'
    })
  },
  updateCourseInfo(courseInfo) {
    return request({
      url: `/service_edu/course/updateCourseInfo`,
      method: 'post',
      data: courseInfo
    })
  },
  getPublishInfo(id) {
    return request({
      url: `/service_edu/course/getPublishCourseInfo/${id}`,
      method: 'get'
    })
  },
  publish(id) {
    return request({
      url: `/service_edu/course/publish/${id}`,
      method: 'post'
    })
  },
  getList(courseQuery) {
    return request({
      url: `/service_edu/course/getList`,
      method: 'post',
      data: courseQuery
    })
  },
  deleteCourse(id) {
    return request({
      url: `/service_edu/course/${id}`,
      method: 'delete',
    })
  }
}
